<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="shortcut icon" th:href="@{/static/favicon.ico}">
    <link th:href="@{/static/css/bootstrap.min.css?v=3.3.7}" rel="stylesheet">
    <link th:href="@{/static/css/font-awesome.css?v=4.4.0}" rel="stylesheet">

    <!-- Data Tables -->
    <link th:href="@{/static/css/plugins/dataTables/dataTables.bootstrap.css}" rel="stylesheet">

    <link th:href="@{/static/css/animate.css}" rel="stylesheet">
    <link th:href="@{/static/css/style.css?v=4.1.0}" rel="stylesheet">

    <!-- 全局js -->
    <script th:src="@{/static/js/jquery.min.js?v=2.1.4}"></script>
    <script th:src="@{/static/js/bootstrap.min.js?v=3.3.7}"></script>
    <script th:src="@{/static/js/plugins/jeditable/jquery.jeditable.js}"></script>
    <!-- Data Tables -->
    <script th:src="@{/static/js/plugins/dataTables/jquery.dataTables.js}"></script>
    <script th:src="@{/static/js/plugins/dataTables/dataTables.bootstrap.js}"></script>

    <!--引入layer插件-->
    <script th:src="@{/static/js/plugins/layer/layer.min.js}"></script>

    <!--引入二次封装的layer-->
    <script th:src="@{/static/js/myLayer.js}"></script>

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div>
                        <button type="button" class="btn btn-sm btn-primary create">添加</button>
                    </div>
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>角色名称</th>
                            <th>角色编码</th>
                            <th>描述</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="gradeX" th:each="item,it : ${list}">
                            <td class="text-center" th:text="${it.count}">11</td>
                            <td th:text="${item.roleName}">22</td>
                            <td th:text="${item.roleCode}">33</td>
                            <td th:text="${item.description}">33</td>
                            <td th:text="${#dates.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}" >33</td>
                            <td class="text-center">
                                <a class="edit" th:attr="data-id=${item.id}">修改</a>
                                <a class="delete" th:attr="data-id=${item.id}">删除</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script th:inline="javascript">
    $(function(){
        $(".create").on("click",function () {
            opt.openWin("/role/create","新增角色",580,430);
        });
        $(".edit").on("click",function () {
            var id = $(this).attr("data-id")
            opt.openWin("/role/edit/" + id,"修改角色",580,430);
        });
        $(".delete").on("click",function () {
            var id = $(this).attr("data-id")
            opt.confirm("/role/delete/" + id,"你清楚你在干什么嘛？？")
        })
    });
</script>
</body>
</html>